{% if pageData["show"] != "embedded" %}
{% extends '/ic/dashboard.html' %}
{% endif %}
{% block content %}
<div class="row">
    <div class="col-md-12">
</div>
</div>
<div class="comuni-e-servizi">
<br>
<div class="row">
    <div class="col-md-12">
        {% for st in pageData['statics'] %}
            <div class="panel panel-warning">
                <div class="panel-heading">
                      <p  class="panel-title">
                    <a style="white-space: normal;" data-slidepanel="panel" href="/italiaCives/cms/{{st.permalink}}" class="btn btn-lg btn-block">{{st.title}}</a>
                </p></div>

            </div>
        {% endfor %}
    </div>
</div>

<!-- PARTE CATEGORIE  CATALOGHI E OPENDATA -->


 <div class="row">
    <div class="col-md-12">
        <div class="panel-group" id="accordion"><!-- PANEL PRINCIPALE CON I CATALOGHI -->
            {% for ca in pageData["cataloghi"] %}
                <div class="panel panel-info"><!-- TIPO PANEL PRINCIPALE CON I CATALOGHI -->
                    <div class="panel-heading">
                        <p class="panel-title">
                            <a data-toggle="collapse" data-parent="#accordion" href="#collapse{{ca.id}}_cat" class="btn btn-lg btn-block" >
                                <i style="color:{{ca.colore_icona_font}}" class="fa {{ca.icona_font}} fa-lg"></i>&nbsp;{{ca.denominazione}}
                            </a>
                        </p>
                    </div>
                        <div id="collapse{{ca.id}}_cat" class="panel-collapse collapse">
                            <div class="panel-body">
                                <div class="panel-group" id="accordione"><!-- PANEL PRINCIPALE CON LE CATEGORIE -->
                                    {% for st in ca.categoria %}
                                        <div class="panel panel-danger"><!-- TIPO PANEL PRINCIPALE CON LE CATEGORIE -->
                                            <div class="panel-heading">
                                                    <p class="panel-title">
                                                        <a data-toggle="collapse" data-parent="#accordione" href="#{{st.id}}_sotto_{{st.denominazione_breve}}" class="list-group-item collapsed rosino"><i style="color:{{st.colore_icona_font}}" class="fa {{st.icona_font}} fa-2x"></i>    &nbsp;{{st.denominazione}}</a>
                                                    </p>
                                            </div>
                                            <div id="{{st.id}}_sotto_{{st.denominazione_breve}}" class="panel-collapse collapse">
                                                <div class="panel-body">
                                                    <div class="item-group" id="accordiones" >
                                                        {% for k in st.rilevazioni %}
                                                            <a  data-slidepanel="panel" data-parent="#accordiones" preview="/pg/ac_Rilevazioni/Preview?id={{k.id}}&pp=1" href="/pg/ac_Rilevazioni/Preview?id={{k.id}}&pp=1" class="list-group-item giallino anteprima ">
                                                                {% for k,v in k.titoli().iteritems() %}
                                                                    {{v}} &nbsp;
                                                                {% endfor %}
                                                            </a>
                                                        {% endfor %}
                                                    </div>
                                                </div>
                                                    <div class="panel-footer">
                                                        {{st.descrizione}}
                                                    </div>

                                            </div>
                                        </div>
                                    {% endfor %}
                                </div>
                            </div>
                        </div>
                </div>
            {% endfor %}
        </div>
    </div>
</div> <!-- /row  -->
</div>
{% endblock%}
<script type="text/javascript">
$(document).ready(function () {
    $('.infinite-container3').empty()
//$(".anteprima").click(function(e){
     ////$('html').css('overflow','hidden');
           //// lock scroll position, but retain settings for later
      //var scrollPosition = [
        //self.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft,
        //self.pageYOffset || document.documentElement.scrollTop  || document.body.scrollTop
      //];
      //var html = jQuery('html'); // it would make more sense to apply this to body, but IE7 won't have that
      //html.data('scroll-position', scrollPosition);
      //html.data('previous-overflow', html.css('overflow'));
      //html.css('overflow', 'hidden');
      //window.scrollTo(scrollPosition[0], scrollPosition[1]);

      //});

          $('[data-slidepanel]').slidepanel({
              orientation: 'right',
              mode: 'push',
          });
  //$("a.close").click(function(e){
      ////$('html').css('overflow','scroll');
            //// un-lock scroll position
      //var html = jQuery('html');
      //var scrollPosition = html.data('scroll-position');
      //html.css('overflow', html.data('previous-overflow'));
      //window.scrollTo(scrollPosition[0], scrollPosition[1])

          //});

  $(".cb_slide_panel").swipe( {
//Generic swipe handler for all directions

swipeRight: function() {
$("a.close").click();


},
//Default is 75px, set to 0 for demo so any distance triggers swipe
threshold:75
});


});
</script>
